/* styles.css */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    /* background-color: #f5f5f5; */
    background: #2980B9;  /* fallback for old browsers */
    background: -webkit-linear-gradient(to left, #FFFFFF, #6DD5FA, #2980B9);  /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to left, #FFFFFF, #6DD5FA, #2980B9); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

    margin: 0;
    font-family: Arial, sans-serif;
}

.login-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 400px;
}

.logo img {
    display: block;
    margin: 0 auto 20px;
    width: 150px;
}

.login-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab {
    cursor: pointer;
    padding: 5px 10px;
    margin: 0 5px;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab.inactive {
    color: #666;
}

.input-group {
    position: relative;
    margin-bottom: 20px; /* 调大间距使其更接近参考图 */
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px; /* 调大垂直间距，增加左侧内边距给图标留空间 */
    border: 1px solid #ddd;
    border-radius: 6px; /* 微调圆角使其更接近参考图 */
    box-sizing: border-box;
    font-size: 14px; /* 增大文本大小 */
    height: 48px; /* 调高输入框高度 */
}

.input-group label {
    position: absolute;
    left: 15px; /* 距离左侧增大 */
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2; /* 确保图标在输入框上方 */
}

.input-group .toggle-password {
    position: absolute;
    right: 15px; /* 距离右侧增大 */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    z-index: 2; /* 确保图标在输入框上方 */
}

.login-box {
    padding: 35px; /* 微调内部间距 */
}

/* 输入框获得焦点时的样式 */
.input-group input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    outline: none;
}

.terms {
    text-align: center;
    margin: 10px 0;
}

.terms small {
    font-size: 12px;
}

.login-button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.links {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.links a {
    font-size: 12px;
    color: #007bff;
    text-decoration: none;
}

/* 第一次修改，添加了一个错误动画？有必要吗？ */
/* 添加在现有样式之后 */
/* 添加错误动画 */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* 登录验证码 */
/* 验证码容器 */
.verification-code {
    margin-bottom: 20px;
}

/* 验证码内容容器 */
.captcha-container {
    display: flex;
    align-items: center;
}

/* 验证码输入框 */
#captcha {
    flex: 1; /* 输入框占据左侧空间 */
    margin-right: 10px; /* 输入框与验证码图之间的间隙 */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* 验证码图片 */
.captcha-image {
    width: 100px; /* 验证码图宽度 */
    height: 40px; /* 验证码图高度 */
    cursor: pointer; /* 点击刷新验证码 */
    border: 1px solid #ccc;
    border-radius: 4px;
}



/*接下来更像是对register.html的渲染*/

.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-header h2 {
    margin-bottom: 8px;
    color: #333;
}

.form-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.tab.inactive,
.tab.active {
    padding: 8px 20px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.tab.active {
    border-bottom-width: 3px;
}

.links {
    justify-content: center; /* 使返回登录按钮居中 */
}

.return-login {
    font-weight: bold;
    font-size: 14px;
}

/* 密码可见性图标样式 */
.fa-eye-slash::before {
    content: "\f070";
}


/* 验证码容器 */
.captcha-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.captcha-container .input-group {
    flex: 1;
    margin-bottom: 0;
}

.captcha-image {
    margin-left: 15px;
    display: flex;
    align-items: center;
}

#captcha-canvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #007bff;
    margin-left: 8px;
    font-size: 16px;
    padding: 8px;
    border-radius: 4px;
}

.refresh-btn:hover {
    background-color: #f0f0f0;
}

/* 错误提示样式 */
.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* 验证错误时的输入框样式 */
.input-group.error input {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* 验证成功时的输入框样式 */
.input-group.success input {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}
/* 按钮样式 */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background-color 0.3s;
}

.btn-captcha {
    background-color: #28a745;
}

.btn-captcha:hover {
    background-color: #218838;
}